### Project 18 Reed Switch Module **1.Introduction** The reed switch grass tube is full of highly purified inactive gas. Before operating, the two reeds are separated. Extra magnetic field produces different polarity around the endpoint of the two reeds, so that two different polar reeds attract each other and close. In this project, we use graphical programming and regard reed switch module and magnet as a switch to control the on and off of LED. **2.Materials Required** 1. KEYESTUDIO UNO Control Board *1 2. V5 Sensor Shield*1 3. Piranha LED*1 4. Reed Switch Module*1 5. Female to Female Dupont Line*6 **3.Connection Diagram** ![](media/image-20251201165801020.png) ![](media/image-20251201165813100.png) **4.Sample Code** ```c void setup() { pinMode( 3 , INPUT); pinMode( 6 , OUTPUT); } void loop() { if (( digitalRead(3) && HIGH )) { digitalWrite( 6 , HIGH ); } else { digitalWrite( 6 , LOW ); } } ``` **5.Result** After downloading is done, you can check whether there is magnetic field using reed switch module.